import http from '@/utils/httpRequest.js'

export function policy(fileName) {
  return new Promise((resolve, reject) => {
    http({
      url: http.adornUrl("/tps/oss/policy"),
      method: "get",
      params: http.adornParams({
        fileName:fileName
      })
    }).then(({
      data
    }) => {
      resolve(data);
    })
  });
};

export function policyImg() {
  return  new Promise((resolve,reject)=>{
    http({
        url: http.adornUrl("/tps/oss/policyImg"),
        method: "get",
        params: http.adornParams({})
    }).then(({ data }) => {
        resolve(data);
    })
});
};

export function getRandId(header){
    var timestamp=new Date().getTime();
    var res=header+'_'+timestamp;
    return res;
};


